package cn.edu.nuc.thrid.model;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

public class Goods {

	private String zybgoodid;

	@NotEmpty(message = "名称不能为空")
	private String zybgoodname;

	@NotNull(message = "价格不能为空")
	private Double zybprice;

	@NotNull(message = "数量不能为空")
	
	@Min(1)
	@Max(9999)
	private Integer zybquantity;

	private String zybgoodstate;

	@NotNull(message = "简介不能为空")
	@NotEmpty(message = "简介不能为空")
	//@Size(min = 10, max = 100, message = "简介字数在10-100之间")
	// @Pattern(message = "简介字数在20-100之间", regexp = "[a-zA-Z0-9]{40,199}")
	private String zybgooddesc;

	public String getZybgoodid() {
		return zybgoodid;
	}

	public void setZybgoodid(String zybgoodid) {
		this.zybgoodid = zybgoodid;
	}

	

	public String getZybgoodname() {
		return zybgoodname;
	}

	public void setZybgoodname(String zybgoodname) {
		this.zybgoodname = zybgoodname;
	}

	public Double getZybprice() {
		return zybprice;
	}

	public void setZybprice(Double zybprice) {
		this.zybprice = zybprice;
	}

	public Integer getZybquantity() {
		return zybquantity;
	}

	public void setZybquantity(Integer zybquantity) {
		this.zybquantity = zybquantity;
	}

	public String getZybgoodstate() {
		return zybgoodstate;
	}

	public void setZybgoodstate(String zybgoodstate) {
		this.zybgoodstate = zybgoodstate == null ? null : zybgoodstate.trim();
	}

	public String getZybgooddesc() {
		return zybgooddesc;
	}

	public void setZybgooddesc(String zybgooddesc) {
		this.zybgooddesc = zybgooddesc == null ? null : zybgooddesc.trim();
	}

	@Override
	public String toString() {
		return "Goods [zybgoodid=" + zybgoodid + ", zybgoodname=" + zybgoodname + ", zybprice=" + zybprice
				+ ", zybquantity=" + zybquantity + ", zybgoodstate=" + zybgoodstate + ", zybgooddesc=" + zybgooddesc
				+ "]";
	}

}